package com.example.Cairodio.test;

import java.util.ArrayList;

import com.example.Cairodio.CommentsActivity;
import com.example.Cairodio.R;
import com.jayway.android.robotium.solo.Solo;

import android.content.Intent;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.ListView;

public class RobotuimCommentsActivity extends
		ActivityInstrumentationTestCase2<CommentsActivity> {
	
	private Solo solo;
	final int COMMENT_ID = 0;

	public RobotuimCommentsActivity() {
		super("com.example.Cairodio", CommentsActivity.class);
	}

	protected void setUp() throws Exception {
		super.setUp();
		solo = new Solo(getInstrumentation(), getActivity());
		Intent newIntent = new Intent();
		
		getInstrumentation().getTargetContext();

		ArrayList<String> list = new ArrayList<String>();
		list.add("comment1");
		list.add("comment2");
		list.add("comment3");
	
		solo.getCurrentActivity().startActivityForResult(newIntent, COMMENT_ID);
	}

	public void testListView() {
		ListView commentsList = (ListView) solo.getView(R.id.commentsList01);
		assertTrue(commentsList.getAdapter().getCount() == 3);
	}
	

}
